import { useTranslation } from '@i18next-toolkit/react';
import { useMemo } from 'react';

export function useCountryMap() {
  const { t } = useTranslation();

  return useMemo(
    () => ({
      AD: t('Andorra'),
      AE: t('United Arab Emirates'),
      AF: t('Afghanistan'),
      AG: t('Antigua and Barbuda'),
      AI: t('Anguilla'),
      AL: t('Albania'),
      AM: t('Armenia'),
      AO: t('Angola'),
      AQ: t('Antarctica'),
      AR: t('Argentina'),
      AS: t('American Samoa'),
      AT: t('Austria'),
      AU: t('Australia'),
      AW: t('Aruba'),
      AX: t('Åland Islands'),
      AZ: t('Azerbaijan'),
      BA: t('Bosnia and Herzegovina'),
      BB: t('Barbados'),
      BD: t('Bangladesh'),
      BE: t('Belgium'),
      BF: t('Burkina Faso'),
      BG: t('Bulgaria'),
      BH: t('Bahrain'),
      BI: t('Burundi'),
      BJ: t('Benin'),
      BL: t('Saint Barthélemy'),
      BM: t('Bermuda'),
      BN: t('Brunei Darussalam'),
      BO: t('Bolivia, Plurinational State of'),
      BQ: t('Bonaire, Sint Eustatius and Saba'),
      BR: t('Brazil'),
      BS: t('Bahamas'),
      BT: t('Bhutan'),
      BV: t('Bouvet Island'),
      BW: t('Botswana'),
      BY: t('Belarus'),
      BZ: t('Belize'),
      CA: t('Canada'),
      CC: t('Cocos (Keeling) Islands'),
      CD: t('Congo, the Democratic Republic of the'),
      CF: t('Central African Republic'),
      CG: t('Congo'),
      CH: t('Switzerland'),
      CI: t("Côte d'Ivoire"),
      CK: t('Cook Islands'),
      CL: t('Chile'),
      CM: t('Cameroon'),
      CN: t('China'),
      CO: t('Colombia'),
      CR: t('Costa Rica'),
      CU: t('Cuba'),
      CV: t('Cabo Verde'),
      CW: t('Curaçao'),
      CX: t('Christmas Island'),
      CY: t('Cyprus'),
      CZ: t('Czechia'),
      DE: t('Germany'),
      DJ: t('Djibouti'),
      DK: t('Denmark'),
      DM: t('Dominica'),
      DO: t('Dominican Republic'),
      DZ: t('Algeria'),
      EC: t('Ecuador'),
      EE: t('Estonia'),
      EG: t('Egypt'),
      EH: t('Western Sahara'),
      ER: t('Eritrea'),
      ES: t('Spain'),
      ET: t('Ethiopia'),
      FI: t('Finland'),
      FJ: t('Fiji'),
      FK: t('Falkland Islands (Malvinas)'),
      FM: t('Micronesia, Federated States of'),
      FO: t('Faroe Islands'),
      FR: t('France'),
      GA: t('Gabon'),
      GB: t('United Kingdom of Great Britain and Northern Ireland'),
      GD: t('Grenada'),
      GE: t('Georgia'),
      GF: t('French Guiana'),
      GG: t('Guernsey'),
      GH: t('Ghana'),
      GI: t('Gibraltar'),
      GL: t('Greenland'),
      GM: t('Gambia'),
      GN: t('Guinea'),
      GP: t('Guadeloupe'),
      GQ: t('Equatorial Guinea'),
      GR: t('Greece'),
      GS: t('South Georgia and the South Sandwich Islands'),
      GT: t('Guatemala'),
      GU: t('Guam'),
      GW: t('Guinea-Bissau'),
      GY: t('Guyana'),
      HK: t('Hong Kong'),
      HM: t('Heard Island and McDonald Islands'),
      HN: t('Honduras'),
      HR: t('Croatia'),
      HT: t('Haiti'),
      HU: t('Hungary'),
      ID: t('Indonesia'),
      IE: t('Ireland'),
      IL: t('Israel'),
      IM: t('Isle of Man'),
      IN: t('India'),
      IO: t('British Indian Ocean Territory'),
      IQ: t('Iraq'),
      IR: t('Iran, Islamic Republic of'),
      IS: t('Iceland'),
      IT: t('Italy'),
      JE: t('Jersey'),
      JM: t('Jamaica'),
      JO: t('Jordan'),
      JP: t('Japan'),
      KE: t('Kenya'),
      KG: t('Kyrgyzstan'),
      KH: t('Cambodia'),
      KI: t('Kiribati'),
      KM: t('Comoros'),
      KN: t('Saint Kitts and Nevis'),
      KP: t("Korea, Democratic People's Republic of"),
      KR: t('Korea, Republic of'),
      KW: t('Kuwait'),
      KY: t('Cayman Islands'),
      KZ: t('Kazakhstan'),
      LA: t("Lao People's Democratic Republic"),
      LB: t('Lebanon'),
      LC: t('Saint Lucia'),
      LI: t('Liechtenstein'),
      LK: t('Sri Lanka'),
      LR: t('Liberia'),
      LS: t('Lesotho'),
      LT: t('Lithuania'),
      LU: t('Luxembourg'),
      LV: t('Latvia'),
      LY: t('Libya'),
      MA: t('Morocco'),
      MC: t('Monaco'),
      MD: t('Moldova, Republic of'),
      ME: t('Montenegro'),
      MF: t('Saint Martin (French part)'),
      MG: t('Madagascar'),
      MH: t('Marshall Islands'),
      MK: t('North Macedonia'),
      ML: t('Mali'),
      MM: t('Myanmar'),
      MN: t('Mongolia'),
      MO: t('Macao'),
      MP: t('Northern Mariana Islands'),
      MQ: t('Martinique'),
      MR: t('Mauritania'),
      MS: t('Montserrat'),
      MT: t('Malta'),
      MU: t('Mauritius'),
      MV: t('Maldives'),
      MW: t('Malawi'),
      MX: t('Mexico'),
      MY: t('Malaysia'),
      MZ: t('Mozambique'),
      NA: t('Namibia'),
      NC: t('New Caledonia'),
      NE: t('Niger'),
      NF: t('Norfolk Island'),
      NG: t('Nigeria'),
      NI: t('Nicaragua'),
      NL: t('Netherlands'),
      NO: t('Norway'),
      NP: t('Nepal'),
      NR: t('Nauru'),
      NU: t('Niue'),
      NZ: t('New Zealand'),
      OM: t('Oman'),
      PA: t('Panama'),
      PE: t('Peru'),
      PF: t('French Polynesia'),
      PG: t('Papua New Guinea'),
      PH: t('Philippines'),
      PK: t('Pakistan'),
      PL: t('Poland'),
      PM: t('Saint Pierre and Miquelon'),
      PN: t('Pitcairn'),
      PR: t('Puerto Rico'),
      PS: t('Palestine, State of'),
      PT: t('Portugal'),
      PW: t('Palau'),
      PY: t('Paraguay'),
      QA: t('Qatar'),
      RE: t('Réunion'),
      RO: t('Romania'),
      RS: t('Serbia'),
      RU: t('Russian Federation'),
      RW: t('Rwanda'),
      SA: t('Saudi Arabia'),
      SB: t('Solomon Islands'),
      SC: t('Seychelles'),
      SD: t('Sudan'),
      SE: t('Sweden'),
      SG: t('Singapore'),
      SH: t('Saint Helena, Ascension and Tristan da Cunha'),
      SI: t('Slovenia'),
      SJ: t('Svalbard and Jan Mayen'),
      SK: t('Slovakia'),
      SL: t('Sierra Leone'),
      SM: t('San Marino'),
      SN: t('Senegal'),
      SO: t('Somalia'),
      SR: t('Suriname'),
      SS: t('South Sudan'),
      ST: t('Sao Tome and Principe'),
      SV: t('El Salvador'),
      SX: t('Sint Maarten (Dutch part)'),
      SY: t('Syrian Arab Republic'),
      SZ: t('Eswatini'),
      TC: t('Turks and Caicos Islands'),
      TD: t('Chad'),
      TF: t('French Southern Territories'),
      TG: t('Togo'),
      TH: t('Thailand'),
      TJ: t('Tajikistan'),
      TK: t('Tokelau'),
      TL: t('Timor-Leste'),
      TM: t('Turkmenistan'),
      TN: t('Tunisia'),
      TO: t('Tonga'),
      TR: t('Turkey'),
      TT: t('Trinidad and Tobago'),
      TV: t('Tuvalu'),
      TW: t('Taiwan, Province of China'),
      TZ: t('Tanzania, United Republic of'),
      UA: t('Ukraine'),
      UG: t('Uganda'),
      UM: t('United States Minor Outlying Islands'),
      US: t('United States of America'),
      UY: t('Uruguay'),
      UZ: t('Uzbekistan'),
      VA: t('Holy See'),
      VC: t('Saint Vincent and the Grenadines'),
      VE: t('Venezuela, Bolivarian Republic of'),
      VG: t('Virgin Islands, British'),
      VI: t('Virgin Islands, U.S.'),
      VN: t('Viet Nam'),
      VU: t('Vanuatu'),
      WF: t('Wallis and Futuna'),
      WS: t('Samoa'),
      YE: t('Yemen'),
      YT: t('Mayotte'),
      ZA: t('South Africa'),
      ZM: t('Zambia'),
      ZW: t('Zimbabwe'),
    }),
    []
  );
}

export const ISO_COUNTRIES: Record<string, string> = {
  AFG: 'AF',
  ALA: 'AX',
  ALB: 'AL',
  DZA: 'DZ',
  ASM: 'AS',
  AND: 'AD',
  AGO: 'AO',
  AIA: 'AI',
  ATA: 'AQ',
  ATG: 'AG',
  ARG: 'AR',
  ARM: 'AM',
  ABW: 'AW',
  AUS: 'AU',
  AUT: 'AT',
  AZE: 'AZ',
  BHS: 'BS',
  BHR: 'BH',
  BGD: 'BD',
  BRB: 'BB',
  BLR: 'BY',
  BEL: 'BE',
  BLZ: 'BZ',
  BEN: 'BJ',
  BMU: 'BM',
  BTN: 'BT',
  BOL: 'BO',
  BIH: 'BA',
  BWA: 'BW',
  BVT: 'BV',
  BRA: 'BR',
  VGB: 'VG',
  IOT: 'IO',
  BRN: 'BN',
  BGR: 'BG',
  BFA: 'BF',
  BDI: 'BI',
  KHM: 'KH',
  CMR: 'CM',
  CAN: 'CA',
  CPV: 'CV',
  CYM: 'KY',
  CAF: 'CF',
  TCD: 'TD',
  CHL: 'CL',
  CHN: 'CN',
  HKG: 'HK',
  MAC: 'MO',
  CXR: 'CX',
  CCK: 'CC',
  COL: 'CO',
  COM: 'KM',
  COG: 'CG',
  COD: 'CD',
  COK: 'CK',
  CRI: 'CR',
  CIV: 'CI',
  HRV: 'HR',
  CUB: 'CU',
  CYP: 'CY',
  CZE: 'CZ',
  DNK: 'DK',
  DJI: 'DJ',
  DMA: 'DM',
  DOM: 'DO',
  ECU: 'EC',
  EGY: 'EG',
  SLV: 'SV',
  GNQ: 'GQ',
  ERI: 'ER',
  EST: 'EE',
  ETH: 'ET',
  FLK: 'FK',
  FRO: 'FO',
  FJI: 'FJ',
  FIN: 'FI',
  FRA: 'FR',
  GUF: 'GF',
  PYF: 'PF',
  ATF: 'TF',
  GAB: 'GA',
  GMB: 'GM',
  GEO: 'GE',
  DEU: 'DE',
  GHA: 'GH',
  GIB: 'GI',
  GRC: 'GR',
  GRL: 'GL',
  GRD: 'GD',
  GLP: 'GP',
  GUM: 'GU',
  GTM: 'GT',
  GGY: 'GG',
  GIN: 'GN',
  GNB: 'GW',
  GUY: 'GY',
  HTI: 'HT',
  HMD: 'HM',
  VAT: 'VA',
  HND: 'HN',
  HUN: 'HU',
  ISL: 'IS',
  IND: 'IN',
  IDN: 'ID',
  IRN: 'IR',
  IRQ: 'IQ',
  IRL: 'IE',
  IMN: 'IM',
  ISR: 'IL',
  ITA: 'IT',
  JAM: 'JM',
  JPN: 'JP',
  JEY: 'JE',
  JOR: 'JO',
  KAZ: 'KZ',
  KEN: 'KE',
  KIR: 'KI',
  PRK: 'KP',
  KOR: 'KR',
  KWT: 'KW',
  KGZ: 'KG',
  LAO: 'LA',
  LVA: 'LV',
  LBN: 'LB',
  LSO: 'LS',
  LBR: 'LR',
  LBY: 'LY',
  LIE: 'LI',
  LTU: 'LT',
  LUX: 'LU',
  MKD: 'MK',
  MDG: 'MG',
  MWI: 'MW',
  MYS: 'MY',
  MDV: 'MV',
  MLI: 'ML',
  MLT: 'MT',
  MHL: 'MH',
  MTQ: 'MQ',
  MRT: 'MR',
  MUS: 'MU',
  MYT: 'YT',
  MEX: 'MX',
  FSM: 'FM',
  MDA: 'MD',
  MCO: 'MC',
  MNG: 'MN',
  MNE: 'ME',
  MSR: 'MS',
  MAR: 'MA',
  MOZ: 'MZ',
  MMR: 'MM',
  NAM: 'NA',
  NRU: 'NR',
  NPL: 'NP',
  NLD: 'NL',
  ANT: 'AN',
  NCL: 'NC',
  NZL: 'NZ',
  NIC: 'NI',
  NER: 'NE',
  NGA: 'NG',
  NIU: 'NU',
  NFK: 'NF',
  MNP: 'MP',
  NOR: 'NO',
  OMN: 'OM',
  PAK: 'PK',
  PLW: 'PW',
  PSE: 'PS',
  PAN: 'PA',
  PNG: 'PG',
  PRY: 'PY',
  PER: 'PE',
  PHL: 'PH',
  PCN: 'PN',
  POL: 'PL',
  PRT: 'PT',
  PRI: 'PR',
  QAT: 'QA',
  REU: 'RE',
  ROU: 'RO',
  RUS: 'RU',
  RWA: 'RW',
  BLM: 'BL',
  SHN: 'SH',
  KNA: 'KN',
  LCA: 'LC',
  MAF: 'MF',
  SPM: 'PM',
  VCT: 'VC',
  WSM: 'WS',
  SMR: 'SM',
  STP: 'ST',
  SAU: 'SA',
  SEN: 'SN',
  SRB: 'RS',
  SYC: 'SC',
  SLE: 'SL',
  SGP: 'SG',
  SVK: 'SK',
  SVN: 'SI',
  SLB: 'SB',
  SOM: 'SO',
  ZAF: 'ZA',
  SGS: 'GS',
  SSD: 'SS',
  ESP: 'ES',
  LKA: 'LK',
  SDN: 'SD',
  SUR: 'SR',
  SJM: 'SJ',
  SWZ: 'SZ',
  SWE: 'SE',
  CHE: 'CH',
  SYR: 'SY',
  TWN: 'TW',
  TJK: 'TJ',
  TZA: 'TZ',
  THA: 'TH',
  TLS: 'TL',
  TGO: 'TG',
  TKL: 'TK',
  TON: 'TO',
  TTO: 'TT',
  TUN: 'TN',
  TUR: 'TR',
  TKM: 'TM',
  TCA: 'TC',
  TUV: 'TV',
  UGA: 'UG',
  UKR: 'UA',
  ARE: 'AE',
  GBR: 'GB',
  USA: 'US',
  UMI: 'UM',
  URY: 'UY',
  UZB: 'UZ',
  VUT: 'VU',
  VEN: 'VE',
  VNM: 'VN',
  VIR: 'VI',
  WLF: 'WF',
  ESH: 'EH',
  YEM: 'YE',
  ZMB: 'ZM',
  ZWE: 'ZW',
  XKX: 'XK',
};
